<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
  <head>
    <title>在线预览</title>
<script type="text/javascript" src="FlexPaper/js/jquery.js"></script>
<script type="text/javascript" src="FlexPaper/js/flexpaper_flash.js"></script>
<script type="text/javascript" src="FlexPaper/js/flexpaper_flash_debug.js"></script>
  </head>
  <%--  <%=(String)session.getAttribute("fileName")%>  --%>
  <body> 
        <div style="width: 100%;height: 100%">

            <%

                if (request.getParameter("studentId") != null){%>

            <div>

                <form action="${pageContext.request.contextPath}/grade" method="post" onsubmit="verify()">
                    <input type="hidden" name="studentId" value="<%=request.getParameter("studentId")%>">
                    分数：<input type="text" id="grade" name="grade" placeholder="请输入分数">
                    <input type="submit" value="打分">
                </form>

            </div>

                <%}
            %>

        	<%-- 指定flexPaper的宽度和高度  --%>   
            <a id="viewerPlaceHolder" style="width:100%;height: 800px;;display:block"></a>
            <script type="text/javascript"> 
                var fp = new FlexPaperViewer(    
                         'FlexPaper/swfFiles/FlexPaperViewer', 
                         'viewerPlaceHolder',     <!--对应于a 标签的id-->
                         { config : {
                         SwfFile : escape('upload/<%=(String)request.getParameter("readOnlinePath")%>'),  <!--导入的.swf的路径,文件名称使用英语表示，中文时显示不出来，暂时未解决这个问题-->
                         Scale : 1,
                         ZoomTransition : 'easeOut',
                         ZoomTime : 0.5,
                         ZoomInterval : 0.2,
                         FitPageOnLoad : true,
                         FitWidthOnLoad : false,
                         <%--PrintEnabled : true,&lt;%&ndash; 是否可以打印  &ndash;%&gt;--%>
                         FullScreenAsMaxWindow : true,
                         ProgressiveLoading : false,
                         MinZoomSize : 0.2,
                         MaxZoomSize : 5,
                         SearchMatchAll : false,
                         InitViewMode : 'Portrait',
                         
                         ViewModeToolsVisible : true,
                         ZoomToolsVisible : true,
                         NavToolsVisible : true,
                         CursorToolsVisible : true,
                         SearchToolsVisible : true,
                           localeChain: 'en_US'
                         }});
            </script>
        </div>

  <script>
      function verify(){
          var flag = false;
         var  inputGrade = document.getElementById("grade");
          if (inputGrade.value == null || inputGrade.value == ""){
              alert("不能输入空值");

          }else if (inputGrade.value == 0){
              alert("不能输入0分");

          }else if (inputGrade.value > 100){
              alert("不能输入大于100分");
          }else {
             flag = true;
          }
          return flag;
      }

  </script>
</body>
</html>
